package com.gzw.jackyweather;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

/**
 * Created by JACKYGUO on 2017-01-22.
 */

public class SettingFragment extends Fragment {

    //城市管理
    private TextView tv_setCity;
    //更换皮肤
    private TextView tv_changeSkin;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.setting_fragment, container, false);
        tv_setCity = (TextView) view.findViewById(R.id.tv_setcity);
        tv_changeSkin = (TextView) view.findViewById(R.id.tv_changeSkin);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        tv_setCity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                WeatherActivity weatherActivity = (WeatherActivity) getActivity();
//                weatherActivity.closeDraw();
//                weatherActivity.setSystemUIState(false);
                Intent intent = new Intent(getActivity(), CitySettingActivity.class);
                startActivity(intent);
            }
        });

        tv_changeSkin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                WeatherActivity weatherActivity = (WeatherActivity) getActivity();
//                weatherActivity.closeDraw();
//                weatherActivity.setSystemUIState(false);
                Intent intent = new Intent(getActivity(), SkinActivity.class);
                startActivity(intent);
            }
        });
    }
}
